/*
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *   Author: Tick <ticktock35@gmail.com>
 */

#ifndef __MOKOKO_FEATURE_H__
#define __MOKOKO_FEATURE_H__

#include "list.h"

struct __MOKOKO_FEATURE_VALUE {
    char * value;
    struct list_head node;
};

struct __MOKOKO_FEATURE {
    char * name;
    struct list_head value_head;
    struct list_head node;
    int length;
};

struct __Feature {
    struct list_head feature_head;
    int length;
};

typedef struct __MOKOKO_FEATURE_VALUE 	Feature_Value;
typedef struct __MOKOKO_FEATURE  	Feature;
typedef struct __Feature 		Features;

Features * mokoko_features_singlton_get();
Feature *mokoko_feature_search(Features *, const char *key);
int mokoko_feature_has_value(Features *, const char *feature, const char *value);
int mokoko_feature_value_add(Features *, const char *feature, const char *value);
int mokoko_feature_value_del(Features *, const char *feature, const char *value);
char const*mokoko_feature_value_get(Features *, const char *feature, const int index);
int mokoko_feature_del(Features *, const char *feature);
int mokoko_feature_value_count(Features *, const char *feature);
void mokoko_features_cleanup(Features *);
int mokoko_features_count();

#endif
